import { client } from '../core';

import { HTML5Backend } from 'react-dnd-html5-backend'
import { DndProvider } from 'react-dnd'
import { ConfigProvider } from 'antd';

import TestModule from './modules/test';
import './index.css';
import 'animate.css';
import HeaderModule from './modules/header';
import LogoModule from './modules/logo';
import DraggerModule from './modules/dragger';
import TextModule from './modules/text';
import SideBarModule from './modules/sideBar';
import SidePanelModule from './modules/sidePanel';
import layoutModule from '../core/layout';

// 加载monaco编辑器worker资源
import './components/editor/useWorker';
import * as api from './api'

new client({
    root: document.getElementById('root')!,
    redux: true,
    jwt: true,
    goLogin: api.login,
    providers: [
        {
            component: DndProvider as React.ComponentType<unknown>,
            props: {
                backend: HTML5Backend
            }
        },
        {
            component: ConfigProvider as React.ComponentType<unknown>,
            props: {
                theme: {
                    token: {
                        colorPrimary: '#722ed1',
                    }
                }
            }
        }
    ],
    modules: [
        layoutModule,   // 布局模块
        TestModule,   // 测试模块
        HeaderModule, // 自定义header左中右布局
        // LogoModule,   // logo模块
        DraggerModule,   // 拖拽模块
        SideBarModule,  // 侧边模块
        SidePanelModule, // 面板模块
    ],
})

